package com.example.tests;

import static org.junit.Assert.*;

import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.support.PageFactory;

import com.example.tests.pages.FilmInfoPage;
import com.example.tests.pages.LoginPage;
import com.example.tests.pages.MyPageFactory;

public class FilmsTest extends BrowserTest {
	private FilmInfoPage filmPage = new FilmInfoPage();
	
	@Before
	public void setUp(){
		filmPage = PageFactory.initElements(driver, FilmInfoPage.class);
		PageFactory.initElements(driver, filmPage);
	}

	@Test
	public void findFilmTest() {
		MyPageFactory.getPage(driver, LoginPage.class)
			.login(admin)
			.goFilmsPage()
			.findFilmByTitleAndOpenInfo("Вспомнить все");
		assertTrue(filmPage.isMovieDisplayed());
	}
	
}
